#include<iostream>
#include<type_traits>
using namespace std;

template<typename T1, typename T2>
auto MyMin(const T1& a, const T2& b) -> typename common_type<const T1&, const T2&>::type
{
	return a < b ? a : b;
}

template<typename T1, typename T2, typename ... Args>
auto MyMin(const T1& a, const T2& b, Args const& ... args)
-> typename common_type<const T1&, const T2&, Args const& ...>::type
{
	return MyMin(MyMin(a, b), args...);
}

int main(void)
{
	auto minimum = MyMin(4, 5.8f, 3, 1.8, 3, 1.1, 9);
	cout<< minimum <<endl;
	
	return 0;
}
